import { HttpClient } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { Observable } from "rxjs";

@Injectable({
  providedIn: 'root'
})
export class CustomerUsercashFlowService {

  serviceUrls: any = {
    queryGameListUrl: '/gameApp/list', // 应用管理
    queryUserCashFlowListUrl: '/userCashRecord/list', // 查询用户现金流水list
    exportUserCashFlowListUrl: '/userCashRecord/userWalletRecordExcel', // 用户现金流水导出
  }

  constructor(public httpClient: HttpClient) {}

  // 查询应用管理
  getGameListData(params: any) {
    return this.httpClient.post(this.serviceUrls.queryGameListUrl, params).toPromise();
  }

  // 查询现金流水list
  getUserCashFlowList(params: any) {
    return this.httpClient.post(this.serviceUrls.queryUserCashFlowListUrl, params).toPromise();
  }

  // 现金流水导出
  exportUserCashFlowData(params: any) {
    return this.httpClient.get(this.serviceUrls.exportUserCashFlowListUrl, { params, responseType: 'blob' }).toPromise();
  }
}



